﻿<?php
require_once(dirname(__FILE__)."/../config/session.php");
//require_once("yz.php");
require_once(dirname(__FILE__)."/../config/config.inc.php");
require_once(dirname(__FILE__)."/../libs/string/libstr.php");
require_once(dirname(__FILE__)."/../libs/dbclass/dbconn.php");
require_once(dirname(__FILE__)."/../libs/dbclass/dbservice.php");
require_once(dirname(__FILE__)."/../libs/login/login.php");

$mc=new libstr();
$db=new dbconn();
$dbs=new dbservice();
$lp=new login();
function uhtml($str) 
{ 
$farr = array( 
"/\s+/", //过滤多余空白 
//过滤 <script>等可能引入恶意内容或恶意改变显示布局的代码,如果不需要插入flash等,还可以加入<object>的过滤 
"/<(\/?)(script|i?frame|style|html|body|title|link|meta|\?|\%)([^>]*?)>/isU", 
"/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",//过滤javascript的on事件 
); 
$tarr = array( 
" ", 
"＜\1\2\3＞",//如果要直接清除不安全的标签，这里可以留空 
"\1\2", 
); 
$str = preg_replace( $farr,$tarr,$str); 
return $str; 
} 
if($mc->Ismp($_POST["applybtn"])!=""){

if(strtolower(trim($_POST["code"]))!=strtolower(trim($_SESSION["code"])))
	{
		exit("code is wrong");
	}
$_name=$mc->request("name","");
$_shouji=$mc->request("shouji","");
$_email=$mc->request("email","");
$_content=$mc->request("content","");
$_createtime=$mc->request("createtime",date("Y-m-d H:i:s",time()));
$_zhuangtai=$mc->request("zhuangtai","0");

$db->cmd("insert into shenqing_content(id,name,shouji,email,content,createtime,zhuangtai)values(null,'".$_name."','".$_shouji."','".$_email."','".$_content."','".$_createtime."',".$_zhuangtai.")");
echo "apply is ok";

}

?>